package com.ycz.pattern.structure.proxypattern;

/**
 * @Description
 * @ClassName RealImage
 * @Author yanchengzhi
 * @date 2023.11.24 00:59
 */
public class RealImage implements Image {

    private String fileName;

    public RealImage(String fileName) {
        this.fileName = fileName;
        loadFromDisk(fileName);
    }

    @Override
    public void display() {
        System.out.println("displaying：" + fileName);
    }

    private void loadFromDisk(String fileName) {
        System.out.println("资源加载中..." + fileName);
    }
}
